# stage.set_axis(-5, 50, -5, 50)
# stage.create_grid_overlay(10, "grey")
# microbit = codesters.Microbit()
# time = 0
# def interval():
# global time
# data = microbit.get_temp()
# point = codesters.Point(time, data)
# time += 1
# stage.event_interval(interval, 1)
t = codesters.Teacher()
microbits = t.find_text("Microbit()")
try:
tval1 = microbits[0][1].replace(" ", "")
except:
tval1 = "DNE"
t1 = TestObjective()
t1.add_success(tval1 == "microbit=codesters.Microbit()", "Great job!")
t1.add_failure(tval1 == "DNE", "Did you drag in Create micro:bit?")
t1.add_failure(tval1 != "microbit=codesters.Microbit()", "Oops! Make sure you don't change anything in your code editor after dragging in Create micro:bit!")
tester = TestManager()
tester.add_test_list([t1])
tester.run_tests()
tester.display_first_feedback()
-
Run Code
-
Activity Submitted!
提交作品
-
下个活动
-
Stop Running Code
-
Show Chart
-
Show Console
-
Reset Code Editor
-
Codesters How To (opens in a new tab)